﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Threading;

namespace UDPHelper
{
    public class UDPRequestContext
    {
        private static ThreadLocal<UDPRequestContext> _Current = new ThreadLocal<UDPRequestContext>();

        /// <summary>
        /// 当前消息的上下文
        /// </summary>
        public static UDPRequestContext Current
        {
            get { return _Current.Value; }
            set { _Current.Value = value; }
        }

        /// <summary>
        /// 请求的数据
        /// </summary>
        public byte[] UDPData { get; set; }

        /// <summary>
        /// 远程地址
        /// </summary>
        public IPEndPoint RemoteIP { get; set; }
    }
}
